﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Mukhopatro.BusinessLogicLayer;
using Mukhopatro.BusinessEntities;

namespace Mukhopatro.Admin
{
    public partial class add_news : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            CustomerNewsContentBLL bll = new CustomerNewsContentBLL();
            CustomerNewsContent news = new CustomerNewsContent();
            news.Title = txtTite.Text.Trim();
            news.NewsContent = CKEditor1.Text.Trim();
            news.IsActive = chkShowNews.Checked;
            news.PublishDate = DateTime.Now;
            try
            {
                if (bll.CreateNewCustomerNewsContent(news) > 0)
                {
                    respMessage.SetSuccessMessage("News Add Successful.");
                }
                else
                {
                    respMessage.SetSuccessMessage("News Add Failed.");
                }
            }
            catch (Exception ex)
            {
                respMessage.SetSuccessMessage("News Add Failed." + ex.Message);
            }
        }
    }
}